{include file="common/header.tpl"}
<section class="main">	
    <article class="right-col">
    	<h2><a href="{$back}">{$language.title.admin}</a> &raquo; {$language.ahref.update}</h2>
        <form name="frmEdit" id="frmEdit" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}admin/saveedit" class="ui">
        	<input type="hidden" name="padminid" id="padminid" value="{$row->id|escape}"/>
            <input type="hidden" name="pusername" id="pusername" value="{$row->username|escape}"/>
            <ul>
            	{if isset($smarty.session.ADMIN_ERROR)}
                	<li class="error">
                    	{include file="common/error.tpl" errors=$smarty.session.ADMIN_ERROR}
                    </li>
                {/if}
            	<li>
                	<label for="pusername">{$language.label.username}:</label>
                    <strong class="hint">{$row->username|escape}</strong>                    
                </li>
                <li>
                	<label for="ppassword">{$language.label.password}:</label>
                    <div class="txt">
	                	<input type="password" class="text" name="ppassword" id="ppassword" value="" autocomplete="false" />
                	</div>
                </li>
                <li>
                	<label for="ppassword_confirm">{$language.label.password_confirmation}:</label>
                    <div class="txt">
                		<input type="password" class="text" name="ppassword_confirm" id="ppassword_confirm" value="" autocomplete="false" />
                   	</div>
                </li>
                <li>
                	<label for="pfullname">{$language.label.fullname}:</label>
                    <div class="txt">
                		<input type="text" class="text" name="pfullname" id="pfullname" value="{if isset($smarty.session.ADMIN_POST.pfullname)}{$smarty.session.ADMIN_POST.pfullname}{else}{$row->fullname|escape}{/if}" />
                   	</div>
                </li>                
                <li>
                    <label for="ptype">{$language.label.role}:</label>
                    <div class="sel">
                        <select name="ptype" id="ptype">
                        	{foreach key=i item=item from=$arrType}
                            	{if $i < $AppUI->type}
                                	<option value="{$i}" {if isset($smarty.session.ADMIN_POST.ptype) && $smarty.session.ADMIN_POST.ptype == $i}selected="selected"{elseif $row.type == $i}selected="selected"{/if}>{$item}</option>
                                {/if}
                            {/foreach}
                        </select>
                    </div>
                </li>
                <li>
                    <label for="proomid">{$language.label.room}:</label>
                    <div class="sel">
                        <select name="proomid" id="proomid">
                            <option value="0">{$language.common.selected}</option>
                            {if isset($smarty.session.ADMIN_POST.proomid)}
                            	{html_options options=$arrRoom selected=$smarty.session.ADMIN_POST.proomid}
                            {else}
                            	{html_options options=$arrRoom selected=$row.roomid}
                            {/if}
                        </select>
                    </div>
                </li>
                <li>
                 	<button type="submit"><strong>{$language.btn.save}</strong></button>
                    <button type="button" class="cancel" onclick="javascript:document.location.href='{$back}'"><strong>{$language.btn.cancel}</strong></button>
                </li>
            </ul>
        </form>
    </article> 
</section>
{include file="common/footer.tpl"}
                
